<%--
  Created by IntelliJ IDEA.
  User: 86181
  Date: 2022/11/13
  Time: 15:12
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>查询所以登记的入库产品</title>
</head>
<body>
        <table id="queryallwarehousingtab">

        </table>


        <script>
            //加载表格数据
            $(function () {
                $("#queryallwarehousingtab").bootstrapTable({
                    url:"queryGatherallwarehousing.action",
                    method:'post',                      //请求方式（*）
                    contentType:"application/x-www-form-urlencoded", //如果用tomcat就要写这个
                    striped: true,//是否显示隔行变色
                    cache: false,//是否缓存
                    pagination: true,//是否显示分页
                    sortable: true,//是否显示排序
                    sortOrder: "aso",//排序方式
                    sidePagination:"server", //分页方式：client客户端分页，server服务端分页（*）
                    pageNumber: 1,//初始化加载第一页，默认第一页,并记录
                    pageSize: 5,//每页记录数
                    pageList: [5, 10, 15, 20],//可供选择的每页的行数（*）
                    search: false,//是否显示输入框
                    strictSearch: true,
                    showColumns: true,//是否显示所有的列（选择显示的列）
                    showRefresh: true,//是否显示刷新按钮
                    minimumCountColumns: 2,//最少允许的列数
                    clickToSelect: true,//是否启用点击选中行
                    showToggle: true,//是否显示详细视图和列表视图的切换按钮
                    cardView: false,//是否显示详细视图
                    detailView: false,//是否显示父子表
                    //获取查询到的参数
                    queryParams: function (params) {
                        var warehousinggexamine= {
                            pagesize:params.limit,
                            pageno:(params.offset/params.limit)+1,
                            sort:params.sort,
                            sortOrder:params.sort,
                        }
                        return warehousinggexamine
                    },
                    columns:[
                        {
                            field:"gatherId",
                            title:"入库单编号",
                            formatter:function (value,row,index) {
                                if(row.gatherTag=="K002-2"){
                                    return "<a onclick='queryBygahtergatherid("+row.gatherId+")'><span style='color:red'><strong>"+row.gatherId+"</strong></span></a>";
                                }
                                if(row.gatherTag=="K002-3"){
                                    return "<a onclick='queryBygahtergatherid("+row.gatherId+")'><span style='color:goldenrod'><strong>"+row.gatherId+"</strong></span></a>";
                                }
                                if(row.gatherTag=="K002-4"){
                                    return "<a onclick='queryBygahtergatherid("+row.gatherId+")'><span style='color:green'><strong>"+row.gatherId+"</strong></span></a>";
                                }
                            }
                        },
                        {
                            field:"reasonexact",
                            title:"入库理由",
                        },
                        {
                            field:"checkTime",
                            title:"完成时间",
                            formatter:function (value,row,index) {
                                if(row.gatherTag=="K002-2"){
                                    return "<span style='color:red'><strong>未完成</strong></span>";
                                }
                                if(row.gatherTag=="K002-3"){
                                    return "<span style='color:goldenrod'><strong>未完成</strong></span>";
                                }
                                if(row.gatherTag=="K002-4"){
                                    return "<span style='color:green'><strong>"+row.checkTime+"</strong></span>";
                                }
                            }
                        },
                        {
                            field:"amountSum",
                            title:"应入库件数",
                        },
                        {
                            field:"amountSum",
                            title:"已入库总件数",
                            formatter:function (value,row,index) {
                                if(row.gatherTag=="K002-2"){
                                    return "<span style='color:red'><strong>0</strong></span>";
                                }
                                if(row.gatherTag=="K002-3"){
                                    return "<span style='color:goldenrod'><strong>0</strong></span>";
                                }
                                if(row.gatherTag=="K002-4"){
                                    return "<span style='color:green'><strong>"+row.amountSum+"</strong></span>";
                                }
                            }
                        },
                        {
                            field:"gatherTag",
                            title:"入库状态",
                            formatter:function (value,row,index) {
                                if(row.gatherTag=="K002-2"){
                                    return "<span style='color:red'><strong>等待登记</strong></span>";
                                }
                                if(row.gatherTag=="K002-3"){
                                    return "<span style='color:goldenrod'><strong>等待审核</strong></span>";
                                }
                                if(row.gatherTag=="K002-4"){
                                    return "<span style='color:green'><strong>完成</strong></span>";
                                }
                            }
                        },
                    ]

                })
            })
            
            //根据入库单号查询数据
            function queryBygahtergatherid(gatherId) {
                //打开新的选显卡
                $("#tab1").addTabs("入库单查询", "", "queryBygahtergatheridshow.jsp",{"gatherId":gatherId}, true);
                $("#tab1").closeTabs("入库查询")
                //关闭当前选项卡
            }
        </script>
</body>
</html>
